import { BasicColumn, FormSchema } from '@apps/antd-admin/src/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '备注标签',
    dataIndex: 'tagRemark',
    width: 150,
  },
  {
    title: '备注人',
    dataIndex: 'optUserName',
    width: 120,
  },
  {
    title: '备注来源',
    dataIndex: 'sourceType',
    width: 120,
    customRender: ({ record }: Recordable) => {
      if (record.sourceType == 1) {
        return '销售添加';
      }
      if (record.sourceType == 2) {
        return '后台添加';
      }
      return '';
    },
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 150,
  },
];

export const searchFormSchema: FormSchema[] = [];

export const formSchema: FormSchema[] = [
  {
    label: '会员卡Id',
    field: 'userGoodsId',
    component: 'Input',
    required: true,
    show: false,
  },
  {
    label: '备注标签',
    field: 'tagRemark',
    component: 'Input',
    required: true,
  },
  {
    label: '备注来源',
    field: 'sourceType',
    component: 'Input',
    required: true,
    defaultValue: 2,
    show: false,
  },
];
